home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / basic / pbasmlib.zip / BIOS.DOC < prev    next >
Text File  |  1994-02-12  |  29KB  |  950 lines

  1. PBASMLIB Assembly Language Routines for PB3C
  2. Version 1.0
  3. ROM BIOS Interface (BIOS.ASM)
  4. (C) Copyright 1994 by Tim Gerchmez
  5. All Rights Reserved.
  6.  
  7. This unit contains many routines that interface you to the ROM-BIOS
  8. (Basic Input-Output System) in your computer.  It is contained in
  9. PBASMLIB.PBL, and will be immediately accessible to your programs by
  10. including the statements $INCLUDE "PBASMLIB.INC" and $LINK "PBASMLIB.PBL"
  11. at the top of your programs.  Be careful with these routines, as they
  12. provide you with much power and control, and a lot of potential to crash
  13. the computer or cause damage to data/disks.
  14.  
  15. ================================================================================
  16. sub altprintscreen
  17.  
  18. Selects an alternate printscreen routine that
  19. works if the screen length is not 25 lines.  The
  20. default always prints 25 lines.
  21.  
  22. Example: call altprintscreen
  23.  
  24. ================================================================================
  25. FUNCTION biosdiskstatus(d%)
  26.  
  27. Returns the status of the most recent BIOS disk operations.
  28.  
  29. d%: Set to drive (0=A, 1=B...) - Hard disks start with
  30.     128 (First=128, Second=129...)
  31.  
  32. biosdiskstatus: Returns error number:
  33. 0 = OK    1 = Invalid command           2 = Address mark not found
  34. 3 = Disk write protected                4 = Sector not found
  35. 5 = Reset failed                     6 = Floppy disk removed
  36. 7 = Bad parameter table               8 = DMA overrun
  37. 9 = DMA crossed 64K boundary           10 = Bad sector flag
  38. 11 = Bad track flag                     12 = Media type not found
  39. 13 = Invalid number of sectors on format
  40. 14 = Control data address mark detected
  41. 15 = DMA arbitration level out of range
  42. 16 = Uncorrectable CRC or ECC data error
  43. 17 = ECC corrected data error
  44. 32 = Controller failed
  45. 64 = Seek failed                    128 = Disk timed out
  46. 170 = Drive not ready                187 = Undefined error
  47. 204 = Write fault                    224 = Status register error
  48. 255 = Sense operation failed
  49.  
  50. Example: d%=biosdiskstatus(0)
  51.  
  52. ================================================================================
  53. FUNCTION biosdisktype(d%)
  54.  
  55. Returns type of drive installed for specified
  56. floppy (PS/2 and PC/AT)
  57.  
  58. d%: Set to disk number (0=A:, 1=B: ...)
  59. biosdisktype: Returns the following:
  60. 1 = 360K 5 1/4"    2 = 1.2MB 5 1/4"
  61. 3 = 720K 3 1/3"    4 = 1.44MB 3 1/2"
  62. Other = unknown
  63.  
  64. Example: print biosdisktype(0)
  65.  
  66. ================================================================================
  67. sub biosresetfixed(d%)
  68.  
  69. Resets the fixed disk controller, recalibrates drives,
  70. and prepares for subsequent disk I/O.  Set d% to 128-255
  71. (&H80-&Hff) - 128 for first fixed disk, 129 for second, etc.
  72.  
  73. d%: Set to hard disk to reset
  74.  
  75. Example: call biosresetfixed(128)
  76.  
  77. ================================================================================
  78. function bordercolor
  79.  
  80. Returns the color of the screen border (overscan).
  81.  
  82. Example: print bordercolor
  83.  
  84. ================================================================================
  85. sub capslockoff
  86.  
  87. Turns caps lock off
  88.  
  89. Example: call capslockoff
  90.  
  91. ================================================================================
  92. sub capslockon
  93.  
  94. Turns caps lock on
  95.  
  96. Example: call capslockon
  97.  
  98. ================================================================================
  99. function colregblock$(f??,ncr??)
  100.  
  101. Gets a group of consecutive color registers in
  102. one operation.
  103.  
  104. f??: Set to first color register to be retrieved
  105. ncr??: Set to number of color registers to retrieve
  106. colregblock$: Returns a series of 3-byte entries for
  107. red-green-blue (in that order), one entry for each color
  108. register.
  109.  
  110. Example: c$=colregblock$(f??,ncr??)
  111.  
  112. ================================================================================
  113. function convmemsize
  114.  
  115. Returns size of conventional memory in KB.
  116.  
  117. Example: print convmemsize
  118.  
  119. ================================================================================
  120. function equipcode
  121.  
  122. Returns the BIOS equipment list code word.
  123.  
  124. equipcode: Returns code word (FN)
  125.  
  126. Bits             Significance
  127. ----           ------------
  128. 14-15         Number of printers installed
  129. 13            1 if internal modem installed
  130. 12            1 if game adapter installed
  131. 9-11             Number of RS-232 ports installed
  132. 6-7            Number of floppy disks (00=1,01=2,10=3,11=4)
  133. 4-5            Initial video mode (01=40x25,10=80x25,11=monochrome)
  134. 2-3            System board RAM (PC) (00=16k,01=32k,10=48k,11=64k)
  135. 2            1 if pointing device installed (PS/2)
  136. 1            1 if math coprocessor installed
  137. 0             1 if floppy disk drive(s) installed
  138.  
  139. Example: print equipcode
  140.  
  141. ================================================================================
  142. sub fixeddiagnostic
  143.  
  144. Causes the fixed disk controller to perform a built-in
  145. diagnostic self-test.  Call BIOSDISKSTATUS afterwards
  146. to determine if there were any errors.
  147.  
  148. No parameters.
  149.  
  150. Example: call fixeddiagnostic
  151.  
  152. ================================================================================
  153. sub getcharatr(pg%,ch%,atr%)
  154.  
  155. Gets the ASCII character and attribute at the current
  156. cursor position for the specified page.
  157.  
  158. pg%: Set to page to read from
  159. ch%: Returns character in ch%
  160. atr%: Returns attribute in atr%
  161.  
  162. Example: getcharatr 0,ch%,atr%
  163.  
  164. ================================================================================
  165. sub getcolreg(rg%,g%,b%,r%)
  166.  
  167. Gets the contents of the specified color register.  See
  168. SETCOLREG.
  169.  
  170. rg%: Set to color register number to get values for
  171. g%: Returns register value for green (0-255)
  172. b%: Returns register value for blue (0-255)
  173. r%: Returns register value for red (0-255)
  174.  
  175. Example: getcolreg 3,g%,r%,b%
  176.  
  177. ================================================================================
  178. sub getcolregpage(pg%)
  179.  
  180. Returns currently selected page of color registers
  181. (see SETCOLREGPAGE).
  182.  
  183. m%: Returns current color register page selected.
  184.  
  185. Example: call getcolregpage(m%)
  186.  
  187. ================================================================================
  188. sub getconfiginfo(tpe%,mi%)
  189.  
  190. Gets configuration info for the active video subsystem
  191. (EGA,VGA only).
  192.  
  193. tpe%: Returns display type (0 if color, 1 if mono)
  194. mi%: Returns memory installed on EGA board
  195.      (0=64K, 1=128K, 2=192K, 3=256K)
  196.  
  197. Example: getconfiginfo tpe%,mi%
  198.  
  199. ================================================================================
  200. sub getcursorpos(pg%,ssl%,esl%,row%,col%)
  201.  
  202. Gets the position of the cursor on the display in text
  203. coordinates, and the start/ending scan lines.
  204.  
  205. pg%:  Set to screen page of cursor to read
  206. ssl%: Returns start scan line of cursor (if visible)
  207. esl%: Returns end scan line of cursor (if visible)
  208. row%: Returns row location of cursor (1-25)
  209. col%: Returns column location of cursor (1-80)
  210.  
  211. Example: getcursorpos 0,ssl%,esl%,row%,col%
  212.  
  213. ================================================================================
  214. sub getdisplaymode(x%,m%,adp%)
  215.  
  216. Gets the current display mode of the active video
  217. controller.
  218.  
  219. x%: Returns number of character columns on screen (norm. 80)
  220. m%: Returns display mode (see SETVIDEOMODE).  Note that this
  221.     mode differs from what's used with the PB SCREEN statement.
  222. adp%: Returns active display page
  223.  
  224. Example: getdisplaymode x%,m%,adp%
  225.  
  226. ================================================================================
  227. sub getfontinfo (code%,p??,r??,sg??,ofs??)
  228.  
  229. Returns a pointer to the character definition table for
  230. a font, and returns information on that font.
  231.  
  232. code%: Set to the following font code -
  233.        00h = Current INT 1FH contents
  234.        01H = Current INT 43H contents
  235.        02H = ROM 8x14 font (VGA,EGA)
  236.        03H = ROM 8x8 font (chars 00H-7FH)
  237.        04H = ROM 8x8 font (chars 80H-FFH)
  238.        05H = ROM alternate 9x14 font (EGA,VGA)
  239.        06H = ROM 8x16 font (MCGA,VGA)
  240.        07H = ROM alternate 9x16 font (VGA)
  241.  
  242. p??: Returns points (bytes per character)
  243. r??: Returns rows (char rows on screen - 1)
  244. sg??: Returns segment of font table
  245. ofs??: Returns offset of font table
  246.  
  247. Example: getfontinfo code%,p??,r??,sg??,ofs??
  248.  
  249. ================================================================================
  250. SUB getpagingmode(m%)
  251.  
  252. Gets the current paging mode for the color registers
  253. (see SETPAGINGMODE).  This command is not valid in
  254. video mode 13h (320x200x256 graphics).
  255.  
  256. m%: Returns 0 if 4 pages of 64 registers is selected, or
  257.     1 if 16 pages of 16 registers is selected.
  258.  
  259. Example: call getpagingmode(m%)
  260.  
  261. ================================================================================
  262. sub getparallelports(lpt1??,lpt2??,lpt3??)
  263.  
  264. Gets the addresses for parallel ports 1-3.
  265. if 0 returned, port is unavailable.
  266.  
  267. lpt1??,lpt2??,lpt3??: Returns printer port addresses
  268.  
  269. Example: getparallelports l1??,l2??,l3??
  270.  
  271. ================================================================================
  272. sub getpengraphpos(status%,y%,x%)
  273.  
  274. Gets the current status and position of the light pen
  275. for graphics modes.  For text mode, use GETPENPOS.
  276.  
  277. Example: getpengraphpos s%,y%,x%
  278.  
  279. ================================================================================
  280. sub getpenpos(status%,y%,x%)
  281.  
  282. Gets the current status and position of the light pen for
  283. text modes.  For graphics modes, use GETPENGRAPHPOS.
  284.  
  285. status%: Returns status (0=not down/triggered, 1=down/triggered)
  286. y%: Returns character row (text Y coord) (normally 1-25)
  287. x%: Returns character column (text X coord) (normally 1-80)
  288.  
  289. Example: getpenpos s%,y%,x%
  290.  
  291. ================================================================================
  292. sub getserialports(com1??,com2??,com3??,com4??)
  293.  
  294. Gets the addresses for COM ports 1-4.
  295. if 0 returned, port is unavailable
  296.  
  297. com1??,com2??,com3??,com4??: Returns COM port addresses
  298.  
  299. Example: getserialports c1??,c2??,c3??,c4??
  300.  
  301. ================================================================================
  302. sub getsystype(mdl%,smdl%)
  303.  
  304. Retrieves the model and submodel numbers for the system
  305. in use, allowing determination of system type.
  306.  
  307. mdl%: Returns MODEL value (see below)
  308. smdl%: Returns SUBMODEL value (see below)
  309.  
  310.  Machine            Model    Submodel
  311.  -------               -----     --------
  312.  PC                FFh
  313.  PC/XT            FEh
  314.  PC/XT            FBh        00h or 01h
  315.  PCjr            FDh
  316.  PC/AT            FCh        00h or 01h
  317.  PC/XT 286        FCh        02h
  318.  PC Convertible     F9h
  319.  PS/2 Model 30         FAh        00h
  320.  PS/2 Model 50         FCh        04h
  321.  PS/2 Model 60         FCh        05h
  322.  PS/2 Model 80         F8h        00h or 01h
  323.  
  324. Example: getsystype mdl%,smdl%
  325.  
  326. ================================================================================
  327. sub insertoff
  328.  
  329. Turns insert mode off
  330.  
  331. Example: call insertoff
  332.  
  333. ================================================================================
  334. sub inserton
  335.  
  336. Turns insert mode on
  337.  
  338. Example: inserton
  339.  
  340. ================================================================================
  341. function isaltkey
  342.  
  343. Returns 1 if alt key pressed, 0 if not pressed.
  344.  
  345. Example: if isaltkey then print "alt key pressed"
  346.  
  347. ================================================================================
  348. function iscapslock
  349.  
  350. Returns 1 if capslock on, 0 if off
  351.  
  352. Example: print iscapslock
  353.  
  354. ================================================================================
  355. function iscrolock
  356.  
  357. Returns 1 if scroll lock is on, 0 if off.
  358.  
  359. Example: i% = iscrolock
  360.  
  361. ================================================================================
  362. function isctrlkey
  363.  
  364. Returns 1 if CTRL key is pressed, 0 if not
  365.  
  366. Example: print isctrlkey
  367.  
  368. ================================================================================
  369. function isdisk(d%)
  370.  
  371. Returns 1 if readable media is in a disk drive, or 0
  372. if media is unreadable or no disk in drive.
  373.  
  374. d%: Set to disk number (0=A, 1=B... Hard Disks start at 128)
  375. isdisk: Returns 1 if disk in drive, 0 if no disk in drive
  376.  
  377. Example: if isdisk(0) then open "i",#1,"A:\temp"
  378.  
  379. ================================================================================
  380. function isinsert
  381.  
  382. Returns 1 if insert mode is on, or 0 if off.
  383.  
  384. Example: print isinsert
  385.  
  386. ================================================================================
  387. function isleftshift
  388.  
  389. Returns 1 if left shift key pressed, 0 if not.
  390.  
  391. Example: a% = isleftshift
  392.  
  393. ================================================================================
  394. function isnumlock
  395.  
  396. Returns 1 if num lock is on, 0 if off.
  397.  
  398. Example: print isnumlock
  399.  
  400. ================================================================================
  401. function isrightshift
  402.  
  403. Returns 1 if right shift pressed, 0 if not
  404.  
  405. Example: rs% = isrightshift
  406.  
  407. ================================================================================
  408. sub loadfont (b%,tpe%)
  409.  
  410. Loads a ROM BIOS font and reprograms the video controller.
  411. Do a mode set immediately before calling this routine
  412. (See SETVIDEOMODE).
  413.  
  414. b%: Set to character generator block (normally 0)
  415. tpe%: Set to type of font desired:
  416. 1: ROM 8x14 Font
  417. 2: ROM 8x8 Font
  418. 3: ROM 8x16 Font (MCGA/VGA Default)
  419.  
  420. Example: loadfont 0,2
  421.  
  422. ================================================================================
  423. sub loaduserfont(p%,b%,ncd%,fcc%,f$)
  424.  
  425. Loads a font table into the specified block of character
  426. generator RAM and reprograms the video controller.  This
  427. function should be called only immediately after a mode set.
  428. Page 0 of text mode must be active before calling.
  429.  
  430. p%: Set to points (bytes per character)
  431. b%: Set to block of character generator RAM
  432. ncd%: Set to number of characters defined by font table
  433. fcc%: Set to first character code in table
  434. f$: Set to font table string to be loaded
  435.  
  436. Example: loaduserfont p%,b%,ncd%,fcc%,f$
  437.  
  438. ================================================================================
  439. sub numlockoff
  440.  
  441. Turns numlock mode off.
  442.  
  443. Example: call numlockoff
  444.  
  445. ================================================================================
  446. sub numlockon
  447.  
  448. Turns num lock mode on
  449.  
  450. Example: numlockon
  451.  
  452. ================================================================================
  453. function palandbor$
  454.  
  455. Returns a 17-byte buffer describing the values in
  456. palette registers 0-15, and screen border color (see
  457. SETPALANDBOR).  This PALETTE affects both text-mode and
  458. graphics-mode colors, and will control what color is actually
  459. displayed when using a certain number with the COLOR statement.
  460.  
  461. Example: s$=palandbor$
  462.  
  463. ================================================================================
  464. function palreg(r%)
  465.  
  466. Returns the color associated with the specified palette
  467. register.
  468.  
  469. r%: Set to palette register to return value for
  470. palreg: Returns color value
  471.  
  472. Example: a% = palreg(0)
  473.  
  474. ================================================================================
  475. sub pause (ms%)
  476.  
  477. Pauses for the specified time in milliseconds, using
  478. the CMOS clock for timing (hardware-independent).  One
  479. millisecond is 1/1000 of a second.  Smallest resolution of
  480. the DELAY statement is about 50 milliseconds.  This command
  481. will only work on the AT and up.
  482.  
  483. ms%: Set to milliseconds to delay (up to about 32000, or
  484.      about 32 seconds maximum delay).
  485.  
  486. Example:    pause 1000  'Pause for one second
  487.  
  488. ================================================================================
  489. sub pushcasc(sc%,ch%)
  490.  
  491. Pushes a character and scan code in the keyboard
  492. type-ahead buffer.
  493.  
  494. sc%: Set to scan code
  495. ch%: Set to character
  496.  
  497. Example: pushcasc 0,13
  498.  
  499. ================================================================================
  500. sub pushchrs(c$)
  501.  
  502. Pushes a string of characters into the
  503. keyboard type-ahead buffer.  Only the first
  504. 15 characters are accepted at once.  Be sure to
  505. add a CHR$(13) at the end if you want the command
  506. execute upon program exit to DOS.
  507.  
  508. c$: Set to string to stuff into keyboard buffer
  509.  
  510. Example: pushchrs "dir/w"+chr$(13):shell
  511.  
  512. ================================================================================
  513. sub putchar(pg%,ch%,count%)
  514.  
  515. Puts an ASCII character to the display at
  516. the current cursor position, using attribute
  517. of previous character displayed at same position.
  518.  
  519. Example: putchar 0,65,32
  520.  
  521. ================================================================================
  522. sub putcharatr(pg%,ch%,atr%,count%)
  523.  
  524. Puts an ASCII character and attribute to the
  525. display at the current cursor position.
  526.  
  527. pg%: Set to page to write to
  528. ch%: Set to character to write
  529. atr%: Set to attribute to write
  530. count%: Set to number of characters to write
  531.         (replication factor).  This can include
  532.         up to the whole screen in text mode, or
  533.         a single row in graphics modes.
  534.  
  535. Example: call putcharatr(0,15,65,1)
  536.  
  537. ================================================================================
  538. FUNCTION readpixel(pg%,y%,x%)
  539.  
  540. Returns the value of the graphics pixel on the specified
  541. page at the specified coordinates.
  542.  
  543. pg%: Set to page to read
  544. y%: Set to graphics y coordinate (row)
  545. x%: Set to graphics x coordinate (column)
  546. readpixel: Returns pixel value (0-255)
  547.  
  548. Example: a% = readpixel(0,102,95)
  549.  
  550. ================================================================================
  551. sub recalibratefixed(d%)
  552.  
  553. Causes the fixed disk adapter to recalibrate itself
  554. and reposition the drive's arm to cylinder zero.
  555. Call BIOSDISKSTATUS after to check for errors.
  556.  
  557. d%: Set to (128=first fixed disk, 129=second fixed disk)...
  558.  
  559. Example: recalibratefixed 128
  560.  
  561. ================================================================================
  562. sub resetdisks
  563.  
  564. Resets the disk controllers, recalibrates
  565. attached drives, and prepares for disk I/O.
  566. This function resets ALL drives present in system
  567. including hard disk.
  568.  
  569. No parameters.
  570.  
  571. Example: call resetdisks
  572.  
  573. ================================================================================
  574. sub scrollockoff
  575.  
  576. Turns scroll lock mode off
  577.  
  578. Example: call scrollockoff
  579.  
  580. ================================================================================
  581. sub scrollockon
  582.  
  583. Turns scroll lock mode on
  584.  
  585. Example: call scrollockon
  586.  
  587. ================================================================================
  588. sub setblockspec(code%)
  589.  
  590. determines the character blocks selected by bit 3 of
  591. attribute bytes in text modes.
  592.  
  593. code%: Set to block select code -
  594.  
  595. EGA,MCGA:
  596. bits 0-1 = block selected by attribute bytes with bit 3 = 0
  597. bits 2-3 = block selected by attribute bytes with bit 3 = 1
  598. bits 4-7 = Not used, should be zero.
  599.  
  600. VGA:
  601. bits 0,1,4 = block selected by attribute bytes with bit 3 = 0
  602. bits 2,3,5 = block selected by attribute bytes with bit 3 = 1
  603. bits 6,7   = Not used, should be zero.
  604.  
  605. Example: call setblockspec(code%)
  606.  
  607. ================================================================================
  608. sub setbordercolor(cl%)
  609.  
  610. Sets the color of the screen border (overscan).
  611.  
  612. cl%: Set to desired border color
  613.  
  614. Example: setbordercolor 12
  615.  
  616. ================================================================================
  617. sub setcolreg(rg%,g%,b%,r%)
  618.  
  619. Programs an individual color register with a red-green-blue
  620. (RGB) combination value.
  621.  
  622. rg%: Set to color register number to change
  623. g%: Set to value for green (0-255)
  624. b%: Set to value for blue (0-255)
  625. r%: Set to value for red (0-255)
  626.  
  627. Example: setcolreg 1,10,50,90
  628.  
  629. ================================================================================
  630. sub setcolregblock(f??,ncr??,c$)
  631.  
  632. Set a group of consecutive color registers in
  633. one operation.
  634.  
  635. f??: Set to first color register to be set
  636. ncr??: Set to number of color registers to be set
  637. c$: Set to series of 3-byte entries for Red-Green-Blue
  638. (in that order), one entry for each color register.
  639.  
  640. Example: setcolregblock f??,ncr??,c$
  641.  
  642. ================================================================================
  643. sub setcolregpage(pg%)
  644.  
  645. Selects a page of color registers (see SETPAGINGMODE).
  646.  
  647. pg%: Set to individual page of color registers to be selected.
  648.  
  649. Example: setcolregpage 3
  650.  
  651. ================================================================================
  652. sub setcursoremulation(c%)
  653.  
  654. Enables or disables cursor emulation for the
  655. currently active video display. (VGA only)
  656.  
  657. c%: Set to 0 to enable or 1 to disable.
  658.  
  659. Example: setcursoremulation 0
  660.  
  661. ================================================================================
  662. sub setcursorpos(pg%, row%,col%)
  663.  
  664. Positions the cursor on the display, using text
  665. coordinates.  Does not update BASIC's cursor.
  666.  
  667. pg%: Set to screen page desired (normally 0)
  668. row%: Set to Y coordinate desired (normally 1-25)
  669. col%: Set to X coordinate desired (normally 1-80)
  670.  
  671. Example: setcursorpos 0,5,5
  672.  
  673. ================================================================================
  674. sub setcursortype(ssl%,esl%)
  675.  
  676. Sets starting and ending scan lines for the text-
  677. mode cursor.
  678.  
  679. ssl%: Set to starting scan line desired (0-7)
  680. esl%: Set to ending scan line desired (0-7)
  681.  
  682. Example: setcursortype 1,7
  683.  
  684. ================================================================================
  685. sub setdefaultfontvector (tpe%,rs%,rps??)
  686.  
  687. Sets the INT 43H vector to point to a ROM BIOS default
  688. font and updates the video BIOS data area.  Video controller
  689. is not reprogrammed.  Provides font selection in graphics modes.
  690.  
  691. tpe%: Set to desired font:
  692.       1 = ROM 8x14
  693.       2 = 8x8
  694.       3 = 8x16
  695.  
  696. rs%: Set to character rows specifier:
  697.      00 if user specified (specify in rps?)
  698.      01 = 14 rows
  699.      02 = 25 rows
  700.      03 = 43 rows
  701.  
  702. rps??: Set to rows per screen (if rs% = 0)
  703.  
  704. Example: call setdefaultfontvector(3,2,0)
  705.  
  706. ================================================================================
  707. sub setdisktype(d%,tpe%)
  708.  
  709. Selects a floppy disk type for the specified drive.
  710. Not supported for the PC or PC/XT.
  711.  
  712. d%: Set to (0=A, 1=B)...
  713. tpe%: Set to:
  714. 01 = 320/360K floppy in 360K drive
  715. 02 = 320/360K floppy in 1.2MB drive
  716. 03 = 1.2MB floppy in 1.2MB drive
  717. 04 = 720K floppy in 720K drive
  718.  
  719. Example: setdisktype 0,1
  720.  
  721. ================================================================================
  722. sub setdisplaypage(pg%)
  723.  
  724. Selects the active display page for the video display.
  725. (0 is the default display page).
  726.  
  727. pg%: Set to page to display.  Ranges are as follows:
  728.      0-7 for modes 00H/01H (CGA,EGA,MCGA,VGA)
  729.      0-3 for modes 02H/03H (CGA)
  730.      0-7 for modes 02H/03H (EGA,MCGA,VGA)
  731.      0-7 for mode 07H (EGA,VGA)
  732.      0-7 for mode 0DH (EGA,VGA)
  733.      0-3 for mode 0EH (EGA,VGA)
  734.      0-1 for mode 0FH (EGA,VGA)
  735.      0-1 for mode 10H (EGA,VGA)
  736.  
  737. Example: setdisplaypage 0
  738.  
  739. ================================================================================
  740. sub setfontpointer(sg??,ofs??)
  741.  
  742. Sets the INT 1FH font pointer to the user's font table.
  743. This table is used by char. codes 80H-FFH in graphics
  744. modes 04H-06H.  Provides font selection in graphics modes.
  745.  
  746. sg??: Set to segment of font table
  747. ofs??: Set to offset of font table
  748.  
  749. Example: setfontpointer sg??,ofs??
  750.  
  751. ================================================================================
  752. sub setfontvector(rs%,p??,rps??,sg??,ofs??)
  753.  
  754. Sets the INT 43H vector to point to the user's font table
  755. and updates the ROM BIOS data area.  Video controller is not
  756. reprogrammed.  Provides font selection in graphics modes.
  757.  
  758. rs%: Set to character rows specifier:
  759. 00 if user specified (specify in rps??)
  760. 01 = 14 rows
  761. 02 = 25 rows
  762. 03 = 43 rows
  763.  
  764. p??: Set to points (bytes per character)
  765. rps??: Set to rows per screen (if rs% = 0)
  766. sg??: Set to segment of font table
  767. ofs??: Set to offset of font table
  768.  
  769. Example: setfontvector rs%,p??,rps??,sg??,ofs??
  770.  
  771. ================================================================================
  772. sub setgrayscale(f??,ncr??)
  773.  
  774. Transforms the RGB values of one or more color registers
  775. into their gray-scale equivalents.  The original red, green
  776. and blue values that were in the registers are lost.
  777. Doing this in text modes produces some interesting effects.
  778.  
  779. f??: Set to first color register to change
  780. ncr??: Set to number of color registers to change
  781.  
  782. Example: setgrayscale 0,255
  783.  
  784. ================================================================================
  785. sub setgraysumming(c%)
  786.  
  787. Enables or disables gray-scale summing for the
  788. active video display.
  789.  
  790. c%: Set to 0 to enable or 1 to disable.
  791.  
  792. Example: setgraysumming b%
  793.  
  794. ================================================================================
  795. sub setpagingmode(m%)
  796.  
  797. Selects a paging mode for the color registers.
  798.  
  799. m%: Set to 0 for 4 pages of 64 registers, or 1
  800.     for 16 pages of 16 registers.  Not valid in
  801.     mode 13h (320x200x256 graphics).
  802.  
  803. Example: setpagingmode 1
  804.  
  805. ================================================================================
  806. sub setpalandbor(c$)
  807.  
  808. Sets all palette registers and screen border in
  809. one operation.
  810.  
  811. c$: Set to string consisting of 16 one-byte color values
  812. to be loaded into palette regs 0-15, and one byte for border
  813. color (17 bytes total).
  814.  
  815. Example: setpalandbor c$
  816.  
  817. ================================================================================
  818. sub setpaletteloading(c%)
  819.  
  820. Enables or disables default palette loading when a video
  821. mode is set.
  822.  
  823. c%: Set to 0 to enable, or 1 to disable.
  824.  
  825. Example: call setpaletteloading(c%)
  826.  
  827. ================================================================================
  828. sub setpalreg(cv%,pr%)
  829.  
  830. Sets the correspondence of a palette register to
  831. a displayable color.
  832.  
  833. cv%: Set to color value (EGA/VGA; 7 only on MCGA)
  834. pr%: Set to palette register (0-15 EGA/VGA; 18 only on MCGA)
  835.  
  836. Example: setpalreg 5,8
  837.  
  838. ================================================================================
  839. sub setparallelports(lpt1??,lpt2??,lpt3??)
  840.  
  841. Sets the addresses for parallel ports 1-3
  842. (see GETPARALLELPORTS).
  843.  
  844. lpt1??,lpt2??,lpt3??: Set to printer port addresses desired
  845.  
  846. Example: setparallelports l1??,l2??,l3??
  847.  
  848. ================================================================================
  849. sub setrepeatrate(rt%,dly%)
  850.  
  851. Sets the ROM BIOS key repeat rate and delay.
  852.  
  853. rt%: Set to desired rate: 00H-1FH = 30.0 to 2.0 chars per second
  854. dly%: Set to desired delay: 00H-03H = 250msec-1000msec
  855.  
  856. Example: setrepeatrate 0,0
  857.  
  858. ================================================================================
  859. sub setscanlines(code%)
  860.  
  861. Sets number of scan lines for text modes.  Selection
  862. takes effect next time SETVIDEOMODE is used to set mode.
  863. (VGA only)
  864.  
  865. Code%: Set to-
  866.        00H = 200 scan lines (CGA Resolution)
  867.        01H = 350 scan lines (EGA Resolution)
  868.        02H = 400 scan lines (VGA Resolution)
  869.  
  870. Example: setscanlines 0
  871.  
  872. ================================================================================
  873. sub setscreenrefresh(c%)
  874.  
  875. Enables or disables the video refresh for currently
  876. active display.  This effectively blanks the screen
  877. while disabled, and may slightly speed up the computer.
  878. VGA Only.
  879.  
  880. c%: Set to 0 to enable or 1 to disable
  881.  
  882. Example: call setscreenrefresh(0)
  883.  
  884. ================================================================================
  885. sub setserialports(com1??,com2??,com3??,com4??)
  886.  
  887. Sets the addresses for COM ports 1-4 (see GETSERIALPORTS).
  888.  
  889. com1??,com2??,com3??,com4??: Set to serial port addresses desired
  890.  
  891. Example: setserialports c1??,c2??,c3??,c4??
  892.  
  893. ================================================================================
  894. sub setvideomode(m%)
  895.  
  896. Sets the current video display mode and active
  897. video controller
  898.  
  899. m%: Set to video mode desired.  A few of those
  900. available are:
  901.  
  902. 00H - 40x25 text, 16 color, color burst off
  903. 01H - 40x25 text, 16 color
  904. 02H - 80x25 text, color burst off
  905. 03H - 80x25 text, 16 color (default)
  906. 04H - 320x200 graphics, 4 colors
  907. 05H - 320x200 graphics, 4 colors, color burst off
  908. 06H - 640x200, graphics, 2 colors
  909. 07H - 80x25 text, 2 colors (monochrome only)
  910.  
  911. Example: setvideomode 3
  912.  
  913. ================================================================================
  914. sub setvideorefresh(c%)
  915.  
  916. Enables or disables CPU access to video adapter's
  917. I/O ports and video refresh buffer.
  918.  
  919. c%: Set to 0 to enable access or 1 to disable access.
  920.  
  921. Example: setvideorefresh 0
  922.  
  923. ================================================================================
  924. sub toggleblink(t%)
  925.  
  926. Determines whether most significant bit of
  927. a character attribute will select blinking or
  928. intensity.  Toggle on for 8 extra char. background
  929. colors (must be set using FOREGROUND color + 16
  930. with desired background color (COLOR X+16,Y).
  931.  
  932. t%: Set to 0 for intensity or 1 for blinking.
  933.  
  934. Example: toggleblink 0
  935.  
  936. ================================================================================
  937. sub writepixel(pg%,y%,x%,pv%)
  938.  
  939. Draws a point on the graphics display at the
  940. specified coordinate.  The ranges of valid values
  941. depend on the current video mode.
  942.  
  943. pg%: Set to page to write to
  944. y%: Set to graphics Y coordinate (row)
  945. x%: Set to graphics X coordinate (column)
  946. pv%: Set to pixel value to write (0-255)
  947.  
  948. Example: writepixel 0,34,92,127
  949.  
  950.